package com.lvtulife.common.web.util.search;

import com.lvtulife.common.web.util.RequestPageInfo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @标题: PageBean.java
 * @包: com.eclassedu.fw.bean
 * @描述: 分页 isPageAll 查询全部 page默认1 rowsPerPage默认15
 * @作者: liujiancheng
 * @创建时间: 2015年8月25日 上午10:17:06
 * @版本: V1.0
 */
public class PageBean implements Serializable{
    private int page = 1; // 当前页
    private int rowsPerPage = 15; // 每页记录数
    private int offset = 0; // 显示记录的起始数
    private int total = 0; // 总数据数
    private List rows = new ArrayList(0); // 每页查询所得到的结果集
    private List footer = new ArrayList(0); //用于表格下方统计汇总showFooter: true
    private Map<String, Object> combo = new HashMap<String, Object>(0);//下拉框的选项集合
    private Map<String, Object> outher = new HashMap<String, Object>(0);//其它额外参数

    public PageBean() {
    }

    public PageBean(RequestPageInfo requestPageInfo) {
        this.page = requestPageInfo.getPage();
        this.rowsPerPage = requestPageInfo.getRowsPerPage();
    }

    public int getPage() {
        if (page == 0)
            page = 1;
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getRowsPerPage() {
        return rowsPerPage;
    }

    public void setRowsPerPage(int rowsPerPage) {
        this.rowsPerPage = rowsPerPage;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List getRows() {
        return rows;
    }

    public void setRows(List rows) {
        this.rows = rows;
    }

    public List getFooter() {
        return footer;
    }

    public void setFooter(List footer) {
        this.footer = footer;
    }

    public Map<String, Object> getCombo() {
        return combo;
    }

    public void setCombo(Map<String, Object> combo) {
        this.combo = combo;
    }

    public Map<String, Object> getOuther() {
        return outher;
    }

    public void setOuther(Map<String, Object> outher) {
        this.outher = outher;
    }
}
